<template>
  <div style="padding: 10px 15px">
    <!-- 查询条件-->
    <div class="filter-container">
      <el-input
        v-model="listQuery.title"
        placeholder="请输入商户简称/ERP代码"
        style="width: 200px"
        class="filter-item"
        @keyup.enter.native="handleFilter"
      />
      <el-button
        class="filter-item seachbttn"
        type="primary"
        icon="el-icon-search"
        @click="handleFilter"
        >查询</el-button
      >
    </div>
    <div
      class="filter_fenge"
      style="border: none; border-top: 1px solid #d1ddeb"
    />
    <div class="filter-container">
      <el-button
        v-if="Jurisdiction('添加')"
        class="filter-item bttnleft"
        type="primary"
        icon="el-icon-edit"
        @click="handleCreateNorml"
        >新增基础信息</el-button
      >
      <!-- <el-badge :value={tip} class="item"> -->
      <el-button
        v-if="Jurisdiction('添加')"
        class="filter-item bttnleft"
        type="primary"
        icon="el-icon-edit"
        @click="handleCreate"
        >新增资质信息</el-button
      >
      <!-- </el-badge> -->
      <el-button
        v-if="Jurisdiction('删除')"
        class="filter-item"
        type="danger"
        icon="el-icon-delete"
        @click="deleteClick()"
        >删除</el-button
      >
    </div>
    <!--查询条件 end-->

    <!--table-->
    <el-table
      v-loading="listLoading"
      :data="CpnData"
      fit
      highlight-current-row
      style="width: 100%"
      stripe
      class="cpntable"
    >
      <el-table-column
        v-if="Jurisdiction('删除')"
        type="selection"
        width="55"
        fixed="left"
      />
      <el-table-column label="申请类型" align="left" width="80px">
        <template slot-scope="{ row }">
          <span>{{ row.apLyTyp == 0 ? "商户录入" : "系统录入" }}</span>
        </template>
      </el-table-column>
      <el-table-column label="商户简称" align="left" min-width="200px">
        <template slot-scope="{ row }">
          <span>{{ row.name }}</span>
        </template>
      </el-table-column>
      <el-table-column label="商户编号" align="left" width="180px">
        <template slot-scope="{ row }">
          <span>{{ row.mhNo }}</span>
        </template>
      </el-table-column>
      <el-table-column label="系统代码" align="right" min-width="100px">
        <template slot-scope="{ row }">
          <span>{{ row.cpnID }}</span>
        </template>
      </el-table-column>
      <el-table-column label="ERP企业代码" align="right" min-width="100px">
        <template slot-scope="{ row }">
          <span>{{ row.erpCpnId }}</span>
        </template>
      </el-table-column>
      <el-table-column label="客服经理" align="left" width="70px">
        <template slot-scope="{ row }">
          <span>{{ row.customer }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="发起日期"
        align="right"
        width="100px"
        min-width="100px"
      >
        <template slot-scope="{ row }">
          <span>{{ row.opnDtStr }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新时间" align="right" width="160px">
        <template slot-scope="{ row }">
          <span>{{ row.uptDttStr }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="审核状态"
        align="right"
        width="100px"
        min-width="100px"
      >
        <template slot-scope="{ row }">
          <span v-if="row.stt == 1" class="green">{{ row.sttStr }}</span>
          <span v-if="row.stt == 2" class="red">{{ row.sttStr }}</span>
          <span v-if="row.stt == 0">{{ row.sttStr }}</span>
        </template>
      </el-table-column>

      <el-table-column fixed="right" label="操作" width="600">
        <template slot-scope="scope">
          <el-button
            v-if="Jurisdiction('编辑')"
            type="primary"
            size="mini"
            @click="handleClickNorml(scope.row)"
            >编辑基础资料
          </el-button>
          <el-button
            v-if="Jurisdiction('编辑')"
            type="primary"
            size="mini"
            @click="handleClick(scope.row)"
            >上传资质资料
          </el-button>
          <el-button type="primary" size="mini" @click="OpenCpnOrg(scope.row)"
            >门店管理</el-button
          >
          <el-button
            type="primary"
            size="mini"
            @click="blueseaactivityClick(scope.row)"
            >服务商返佣活动报名申请</el-button
          >
          <el-button type="primary" size="mini" @click="ShowClick(scope.row)"
            >资质详情</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="listQuery.total > 0"
      :total="listQuery.total"
      :page.sync="listQuery.page"
      :limit.sync="listQuery.limit"
      @pagination="fetchData(this)"
    />

    <!--table end -->

    <!--弹出层  新增-->
    <el-dialog
      :visible.sync="dialogFormVisible"
      width="55%"
      :before-close="handleClose"
      :show-close="false"
      class="cpnformdialog"
    >
      <el-form
        ref="mngForm"
        :model="mngForm"
        :inline="true"
        label-position="top"
        class="demo-ruleForm"
        :rules="rules"
      >
        <div class="title">
          <div class="cpn_title">新增商户类型</div>
          <div>
            <el-radio-group v-model="mngForm.qalTypStr">
              <el-radio-button label="个体户/企业" />
              <el-radio-button label="个体商户" />
            </el-radio-group>
          </div>
        </div>
        <el-steps :active="active" finish-status="success">
          <el-step title="资质信息" />
          <el-step title="基础信息" />
          <el-step title="结算信息" />
        </el-steps>

        <!--资质信息-->
        <div :class="{ divshow: divid == 0, divnone: divid != 0 }">
          <Cpnmng :cpnform="mngForm" />
        </div>
        <!--基础信息-->
        <div :class="{ divshow: divid == 1, divnone: divid != 1 }">
          <CpnInfo :cpnform="mngForm" />
        </div>
        <!--结算信息-->
        <div :class="{ divshow: divid == 2, divnone: divid != 2 }">
          <CpnSttl :cpnform="mngForm" />
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button v-if="divid != 0" style="float: left" @click="prv"
          >上一步</el-button
        >
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button v-if="divid <= 1" type="primary" @click="next"
          >下一项</el-button
        >
        <el-button v-if="divid == 2" type="primary" @click="saveForm('mngForm')"
          >确认提交</el-button
        >
      </div>
    </el-dialog>

    <!--服务商返佣活动报名申请-->
    <el-dialog
      title="服务商返佣活动报名申请"
      :visible.sync="blueseaactivity_Visible"
      width="55%"
      :show-close="false"
      :before-close="handleClose"
      class="dialog-title"
    >
      <el-form
        ref="form"
        width="60%"
        :model="blueseaactivity_form"
        :inline="true"
      >
        <div style="margin-bottom: 40px">
          <span>请按需上传以下图片信息</span>
          <el-divider />
        </div>

        <el-form-item label="营业执照">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="business_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>
        <el-form-item label="餐饮服务许可证">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="food_service_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="食品卫生许可证">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="food_health_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="食品经营许可证">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="food_business_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="食品流通许可证">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="food_circulate_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="食品生产许可证">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="food_production_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="烟草专卖零售许可证">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="tobacco_lic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="门头照">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="shop_entrance_pic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="内景照">
          <el-upload
            class="upload-demo"
            :file-list="fileList"
            :action="this.baseurl"
            list-type="picture-card"
            :limit="1"
            :on-error="FileError"
            :on-success="FileSuccess"
            :data="indoor_pic"
          >
            <i slot="default" class="el-icon-plus" />
            <div slot="file" slot-scope="{ file }">
              <img
                class="el-upload-list__item-thumbnail"
                :src="file.url"
                alt=""
              />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-preview"
                  @click="handlePictureCardPreview(file)"
                >
                  <i class="el-icon-zoom-in" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleDownload(file)"
                >
                  <i class="el-icon-download" />
                </span>
                <span
                  v-if="!disabled"
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file)"
                >
                  <i class="el-icon-delete" />
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>

        <el-form-item label="活动类型">
          <el-select
            v-model="blueseaactivity_form.biz_scene"
            placeholder="请选择活动类型"
            style="width: 400px !important"
          >
            <el-option
              label="直连餐饮（BLUE_SEA_FOOD_APPLY）"
              value="BLUE_SEA_FOOD_APPLY"
            />
            <el-option
              label="直连快消（BLUE_SEA_FMCG_APPLY）"
              value="BLUE_SEA_FMCG_APPLY"
            />
            <el-option
              label="间连餐饮（BLUE_SEA_FOOD_INDIRECT_APPLY）"
              value="BLUE_SEA_FOOD_INDIRECT_APPLY"
            />
            <el-option
              label="间连快消（BLUE_SEA_FMCG_INDIRECT_APPLY）"
              value="BLUE_SEA_FMCG_INDIRECT_APPLY"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="活动商户号">
          <el-input
            v-model="blueseaactivity_form.merchant_logon"
            placeholder="请填写需要做活动的支付宝商户号"
          />
        </el-form-item>
        <el-form-item label="省份编码">
          <el-input
            v-model="blueseaactivity_form.province_code"
            placeholder="请填写省份编码"
          />
        </el-form-item>
        <el-form-item label="城市编码">
          <el-input
            v-model="blueseaactivity_form.city_code"
            placeholder="请填写城市编码"
          />
        </el-form-item>
        <el-form-item label="区县编码">
          <el-input
            v-model="blueseaactivity_form.district_code"
            placeholder="请填写区县编码"
          />
        </el-form-item>
        <el-form-item label="详细地址">
          <el-input
            v-model="blueseaactivity_form.address"
            type="textarea"
            autosize
            placeholder="请填写详细地址"
          />
        </el-form-item>
        <br />
        <el-form-item>
          <el-button type="primary" @click="blueseaactivity_save()"
            >提交活动申请</el-button
          >
        </el-form-item>
        <br />

        <el-form-item label="申请单id">
          <el-input
            v-model="blueseaactivity_form.order_id"
            placeholder="请填写申请单id"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="blueseaactivity_query()"
            >活动申请状态查询</el-button
          >
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="blueseaactivity_update()"
            >活动申请状态更新</el-button
          >
        </el-form-item>

        <el-form-item id="ipt" style="display: block; width: 100%">
          <el-input
            v-model="blueseaactivity_form.textarea"
            type="textarea"
            autosize
            style="
              height: 400px !important;
              color: green;
              width: 100% !important;
              display: block;
            "
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="blueseaactivity_Visible = false">取 消</el-button>
      </div>
    </el-dialog>

    <!--详情-->

    <el-dialog
      :visible.sync="dialogdetailsVisible"
      width="55%"
      class="detialcpnformdialog"
    >
      <el-form
        ref="mngForm"
        :model="mngForm"
        :inline="true"
        label-position="top"
        class="demo-ruleForm"
        :rules="rules"
      >
        <div class="title" style="pointer-events: none">
          <div class="cpn_title">商户详情</div>
          <el-radio-group v-model="mngForm.qalTypStr">
            <el-radio-button label="个体户/企业" />
            <el-radio-button label="个体商户" />
          </el-radio-group>
        </div>
        <el-steps :active="active" finish-status="success">
          <el-step title="资质信息" />
          <el-step title="基础信息" />
          <el-step title="结算信息" />
        </el-steps>
        <!--资质信息-->

        <div :class="{ divshow: divid == 0, divnone: divid != 0 }">
          <Cpnmng :cpnform="mngForm" />
        </div>
        <!--基础信息-->
        <div :class="{ divshow: divid == 1, divnone: divid != 1 }">
          <CpnInfo :cpnform="mngForm" :is-show="false" />
        </div>
        <!--结算信息-->
        <div :class="{ divshow: divid == 2, divnone: divid != 2 }">
          <CpnSttl :cpnform="mngForm" />
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <!-- {{ mngForm.busdt}} -->
        <el-button v-if="divid != 0" style="float: left" @click="prv"
          >上一步</el-button
        >
        <el-button @click="dialogdetailsVisible = false">取 消</el-button>
        <el-button v-if="divid <= 1" type="primary" @click="next"
          >下一项</el-button
        >
      </div>
    </el-dialog>

    <!--示列图-->
    <el-dialog :visible.sync="mngForm.businesslicdialogVisible">
      <!--营业执照示例-->
      <img width="100%" src="@/assets/blic.jpeg" />
    </el-dialog>
    <el-dialog :visible.sync="mngForm.iDpersondialogVisible">
      <!--省份证人像面示例-->
      <img width="100%" src="@/assets/IDperson.png" />
    </el-dialog>
    <el-dialog :visible.sync="mngForm.nationalemblemdialogVisible">
      <!--省份证国徽面示例-->
      <img width="100%" src="@/assets/Nationalemblem.png" />
    </el-dialog>

    <el-dialog :visible.sync="mngForm.showbigdialogVisible">
      <!--查看大图-->
      <img width="100%" :src="mngForm.showbigurl" />
    </el-dialog>

    <!--弹出层  新增基础资料-->
    <el-dialog
      :title="textMap[dialogStatus]"
      :visible.sync="dialogFormVisibleNoraml"
      width="55%"
      :before-close="handleClose"
      :show-close="false"
      class="dialog-title"
    >
      <el-form :model="form" :inline="true" label-position="top">
        <el-row :gutter="10">
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item
              label="企业名称"
              prop="name"
              :rules="[
                {
                  required: true,
                  message: '企业名称不能为空',
                  trigger: 'blur',
                },
              ]"
            >
              <el-input v-model="form.name" />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item
              label="ERP企业代码"
              prop="eRPCpnId"
              :rules="[
                {
                  required: true,
                  message: '企业代码不能为空',
                  trigger: 'blur',
                },
              ]"
            >
              <el-input v-model="form.eRPCpnId" />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="ERP加密字">
              <el-input v-model="form.deskey" />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="客服经理">
              <el-input v-model="form.customer" class="custom-ipt" />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="企业管理员邮箱">
              <el-input
                v-model="form.lnkEml"
                type="textarea"
                :autosize="{ minRows: 1, maxRows: 1 }"
                style="height: 36px"
              />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="企业管理员电话">
              <el-input v-model="form.lnkPhn" />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="企业对账时间(小时,最早12 最晚23)">
              <el-input-number
                placeholder="输入时间(小时)"
                v-model="form.cioEml"
                controls-position="right"
                :min="12"
                :max="23"
              ></el-input-number>
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="备注">
              <el-input v-model="form.brf" class="remark" />
            </el-form-item>
          </el-col>

          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="交易预警">
              交易核验：
              <el-form-item>
                <el-switch
                  v-model="form.IsCheckMony"
                  active-color="#13ce66"
                  inactive-color="#ff4949"
                  :width="switchwidth"
                  title="启用应急账户后,支付平台可以在其他通道使用有故障时,一键切换到应急账户"
                />
                大额预警：
                <el-switch
                  v-model="form.isCheckMonyMax"
                  active-color="#13ce66"
                  inactive-color="#ff4949"
                  :width="switchwidth"
                  title="启用大额预警后,线下支付交易将进行每笔超额预警"
                />
                <div v-if="form.isCheckMonyMax">
                  预警金额：<el-input v-model="form.CheckMonyMax" class="CheckMonyMax" />
                </div>
              </el-form-item>
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="预警通知地址">
              <el-input v-model="form.RootMsgAPI" class="remark" />
            </el-form-item>
          </el-col>
          <el-col :xs="12" :sm="10" :md="8" :lg="8" :xl="8">
            <el-form-item label="门店">
              <upload-excel-component
                :on-success="handleSuccess"
                :before-upload="beforeUpload"
                style="margin-left: -16px"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-table
          :data="tableData"
          border
          highlight-current-row
          style="width: 100%; margin-top: 20px; height: 400px; overflow: auto"
        >
          <el-table-column
            v-for="item of tableHeader"
            :key="item"
            :prop="item"
            :label="item"
          />
        </el-table>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisibleNoraml = false">取 消</el-button>
        <el-button type="primary" @click="saveFormNormal">确 定</el-button>
      </div>
    </el-dialog>
    <!--弹出层 end-->
  </div>
</template>
<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import { AjaxToken, TipConfirm } from "@/api/common";
import { SelectAjax } from "@/api/common";
import { Jurisdiction } from "@/api/common";
import sessionStorage from "@/api/Storage";
import UploadExcelComponent from "@/components/UploadExcel/index.vue";
import CpnInfo from "./components/CpnInfo"; // 企业基本信息
import CpnSttl from "./components/CpnSttl"; // 企业结算信息
import Cpnmng from "./components/Cpnmng"; // 企业结算信息
import commconfig from "@/comm.json";
import "url-search-params-polyfill";
export default {
  name: "CpnIndex",
  components: {
    Pagination,
    UploadExcelComponent,
    CpnInfo,
    CpnSttl,
    Cpnmng,
  },
  data() {
    return {
      tip: 12,
      active: 0,
      divid: 0,
      business_lic: {
        image_lic: "business_lic",
      },
      food_business_lic: {
        image_lic: "food_business_lic",
      },
      food_service_lic: {
        image_lic: "food_service_lic",
      },
      tobacco_lic: {
        image_lic: "tobacco_lic",
      },
      food_health_lic: {
        image_lic: "food_health_lic",
      },
      shop_entrance_pic: {
        image_lic: "shop_entrance_pic",
      },
      food_circulate_lic: {
        image_lic: "food_circulate_lic",
      },
      food_production_lic: {
        image_lic: "food_production_lic",
      },
      indoor_pic: {
        image_lic: "indoor_pic",
      },
      switchwidth: 60,
      fileList: [],
      provinceOptions: [],
      cityOptions: [],
      districtOptions: [],
      dialogImageUrl: "",
      dialogVisible: false,
      tableData: [],
      tableHeader: [],
      disabled: false,
      orgshow: false,
      succesfile: [],
      multipleSelection: [],
      baseurl: "",
      EnclSurebaseurl: "",
      formLabelWidth: "120px",
      CpnData: null,
      listQuery: {
        title: "",
        total: 0,
        page: 1,
        limit: 10,
      },
      listLoading: true,
      dialogFormVisible: false,
      dialogdetailsVisible: false,
      dialogFormVisibleNoraml: false,
      blueseaactivity_Visible: false,

      dialogStatus: "",
      textMap: {
        update: "修改",
        create: "添加",
      },
      blueseaactivity_form: {
        merchant_logon: "",
        biz_scene: "",
        textarea: "",
        province_code: "510000",
        city_code: "510100",
        district_code: "",
        address: "",
        order_id: "",
      },
      form: {
        cpnID: "",
        name: "",
        cpnItTp: "",
        city: "",
        adr: "",
        tel: "",
        fax: "",
        opnBnk: "",
        actNo: "",
        taxID: "",
        lnkr: "",
        lnkPhn: "",
        lnkEml: "",
        cfo: "",
        cfoPhn: "",
        cfoEml: "",
        cio: "",
        cioPhn: "",
        cioEml: "",
        customer: "",
        opnDt: "",
        stt: "",
        brf: "",
        uptr: "",
        uptDtt: "",
        eRPCpnId: "",
        deskey: "",
        imageUrl: "",
        IsCheckMony: false,
        RootMsgAPI: "",
        CheckMonyMax: 0,
        isCheckMonyMax: false,
      },
      rules: {
        businesslicUrl: [
          {
            required: true,
            message: "请上传营业执照",
            trigger: "blur",
          },
        ],
        busdt: [
          {
            required: true,
            message: "请选择执照有效期",
            trigger: "blur",
          },
        ],
        mngeTyp: [
          {
            required: true,
            message: "请选择经营类型",
            trigger: "blur",
          },
        ],
        regNo: [
          {
            required: true,
            message: "请填写注册号",
            trigger: "blur",
          },
        ],
        regName: [
          {
            required: true,
            message: "请填写注册名称",
            trigger: "blur",
          },
        ],
        iDperson_Url: [
          {
            required: true,
            message: "请上传法人身份证人像面",
            trigger: "blur",
          },
        ],
        nationalemblem_Url: [
          {
            required: true,
            message: "请上传法人身份证国徽面",
            trigger: "blur",
          },
        ],
        mngName: [
          {
            required: true,
            message: "请填写商户简称",
            trigger: "blur",
          },
        ],
        mngLnkPhn: [
          {
            required: true,
            message: "请填写联系人手机号(客户电话)",
            trigger: "blur",
          },
        ],
        mngMhTyp: [
          {
            required: true,
            message: "请选择商户类别",
            trigger: "blur",
          },
        ],
        mngPrv: [
          {
            required: true,
            message: "请选择经营地址所在省份",
            trigger: "blur",
          },
        ],
        mngCty: [
          {
            required: true,
            message: "请选择经营地址所在城市",
            trigger: "blur",
          },
        ],
        mngDit: [
          {
            required: true,
            message: "请选择经营地址所在区县",
            trigger: "blur",
          },
        ],
        mngAdr: [
          {
            required: true,
            message: "请填写经营详细地址",
            trigger: "blur",
          },
        ],
        indoorpic_Url: [
          {
            required: true,
            message: "请上传内景照片",
            trigger: "blur",
          },
        ],
        shopentrancepic_Url: [
          {
            required: true,
            message: "请上传门头照片",
            trigger: "blur",
          },
        ],
        sttlActNm: [
          {
            required: true,
            message: "请填写结算账户名称",
            trigger: "blur",
          },
        ],
        sttlAct: [
          {
            required: true,
            message: "请填写结算账户号",
            trigger: "blur",
          },
        ],
        sttlActBnk: [
          {
            required: true,
            message: "请填写开户行信息",
            trigger: "blur",
          },
        ],
        openActlicence_Url: [
          {
            required: true,
            message: "请上传开户许可证/开户证明",
            trigger: "blur",
          },
        ],
      },
      mngForm: {
        tableData: [],
        tableHeader: [],
        businesslicdialogVisible: false,
        iDpersondialogVisible: false,
        nationalemblemdialogVisible: false,
        showbigdialogVisible: false,
        showbigurl: "",
        cpnenclsures: [],
        eRPCpnId: "",
        deskey: "WUCRMWEB",
        iD: "",
        cpnID: "",
        regNo: "",
        regName: "",
        qalTyp: 0,
        qalTypStr: "个体户/企业",
        busdt: "",
        busnSDt: "",
        busnEDt: "",
        isLongDt: false,
        prv: "",
        cty: "",
        dit: "",
        addr: "",
        crt: "",
        ctr: "",
        mngeTyp: 0,
        businesslic_Url: "",
        iDperson_Url: "",
        nationalemblem_Url: "",
        indoorpic_Url: "",
        shopentrancepic_Url: "",
        placebusiness_Url: "",
        merchantagr_Url: "",
        leaseagrheader_Url: "",
        leaseagrarea_Url: "",
        leaseagrsign_Url: "",
        openActlicence_Url: "",
        otherPic1_Url: "",
        otherPic2_Url: "",
        otherPic3_Url: "",
        otherPic4_Url: "",
        otherPic5_Url: "",
        mngName: "",
        mngLnkPhn: "",
        mngMhTyp: 0,
        mngPrv: "",
        mngCty: "",
        mngDit: "",
        mngAdr: "",
        sttlTyp: "0",
        sttlActNm: "",
        sttlAct: "",
        sttlActBnk: "",
      },

      details_form: {
        cpnID: "",
        name: "",
        cpnItTp: "",
        city: "",
        adr: "",
        tel: "",
        fax: "",
        opnBnk: "",
        actNo: "",
        taxID: "",
        lnkr: "",
        lnkPhn: "",
        lnkEml: "",
        cfo: "",
        cfoPhn: "",
        cfoEml: "",
        cio: "",
        cioPhn: "",
        cioEml: "",
        customer: "",
        opnDt: "",
        stt: "",
        brf: "",
        uptr: "",
        uptDtt: "",
        eRPCpnId: "",
        deskey: "",
      },
    };
  },
  // 初始化
  created() {
    this.baseurl = commconfig.baseapi + "AliPayUploadFile";
    this.EnclSurebaseurl = commconfig.baseapi + "UploadFileAttch";
    this.fetchData();
  },
  methods: {
    prv() {
      this.active = this.active - 1;
      this.divid = this.active;
    },
    next() {
      // console.log(this.mngForm.businesslic_Url);
      // console.log(this.mngForm.busdt);
      var reg =
        /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //手机号验证
      if (this.active == 0) {
        //  if(this.mngForm.isLongDt==false){

        //  }
        if (
          this.mngForm.isLongDt == false &&
          (this.mngForm.busdt == "" || this.mngForm.busdt == null)
        ) {
          this.$message({
            message: "请选择执照有效期",
            type: "error",
          });
        } else if (
          this.mngForm.businesslic_Url == "" ||
          this.mngForm.businesslic_Url == null
        ) {
          this.$message({
            message: "请上传营业执照",
            type: "error",
          });
        } else if (this.mngForm.regNo == "") {
          this.$message({
            message: "请填写注册号",
            type: "error",
          });
        } else if (this.mngForm.regName == "") {
          this.$message({
            message: "请填写注册名称",
            type: "error",
          });
        } else if (
          this.mngForm.iDperson_Url == "" ||
          this.mngForm.iDperson_Url == null
        ) {
          this.$message({
            message: "请上传法人身份证人像面",
            type: "error",
          });
        } else if (
          this.mngForm.nationalemblem_Url == "" ||
          this.mngForm.nationalemblem_Url == null
        ) {
          this.$message({
            message: "请上传法人身份证国徽面",
            type: "error",
          });
        } else {
          if (this.active++ > 2) {
            this.active = 0;
          }
          this.divid = this.active;
        }
      } else if (this.active == 1) {
        if (this.mngForm.mngName == "") {
          this.$message({
            message: "请填写商户简称",
            type: "error",
          });
        } else if (this.mngForm.mngLnkPhn == "") {
          this.$message({
            message: "请填写联系人手机号",
            type: "error",
          });
        } else if (!reg.test(this.mngForm.mngLnkPhn)) {
          this.$message({
            message: "手机号格式不正确",
            type: "error",
          });
        } else if (this.mngForm.mngPrv == "" || this.mngForm.mngPrv == null) {
          this.$message({
            message: "请填写经营地址",
            type: "error",
          });
        } else if (this.mngForm.mngAdr == "") {
          this.$message({
            message: "请填写详细地址",
            type: "error",
          });
        } else if (
          this.mngForm.indoorpic_Url == "" ||
          this.mngForm.indoorpic_Url == null
        ) {
          this.$message({
            message: "请上传内景照片",
            type: "error",
          });
        } else if (
          this.mngForm.shopentrancepic_Url == "" ||
          this.mngForm.shopentrancepic_Url == null
        ) {
          this.$message({
            message: "请上传门头照片",
            type: "error",
          });
        } else {
          if (this.active++ > 2) {
            this.active = 0;
          }
          this.divid = this.active;
        }
      } else {
        if (this.active++ > 2) {
          this.active = 0;
        }
        this.divid = this.active;
      }
    },
    FileSuccess(response, file, fileList) {
      if (!response.success) {
        this.$message({
          message: "上传失败," + response.message,
          type: "error",
        });
      } else {
        var newsuccess = [];
        var resdata = JSON.parse(response.data);
        var name = JSON.stringify(resdata).substring(
          0,
          JSON.stringify(resdata).indexOf(":")
        );
        this.succesfile.forEach((e) => {
          var ename = JSON.stringify(e).substring(
            0,
            JSON.stringify(e).indexOf(":")
          );

          if (name != ename) {
            newsuccess.push(e);
          }
        });
        newsuccess.push(resdata);
        this.succesfile = newsuccess;
      }
    },
    handleRemove(file) {
      var newcpnenclsures = [];
      this.cpnenclsures.forEach((a) => {
        if (a.uid != file.uid) {
          newcpnenclsures.push(a);
        }
      });
      this.cpnenclsures = newcpnenclsures;
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handleDownload(file) {
      console.log(file);
    },
    FileError(err, file, fileList) {},
    // 打开活动申请
    blueseaactivityClick(row) {
      this.succesfile = [];
      this.blueseaactivity_Visible = true;
    },
    // 活动提交
    blueseaactivity_save() {
      this.blueseaactivity_form.textarea = "";
      var params = new URLSearchParams();
      params.append("ImageIds", JSON.stringify(this.succesfile));
      params.append("merchant_logon", this.blueseaactivity_form.merchant_logon);
      params.append("biz_scene", this.blueseaactivity_form.biz_scene);
      params.append("province_code", this.blueseaactivity_form.province_code);
      params.append("city_code", this.blueseaactivity_form.city_code);
      params.append("district_code", this.blueseaactivity_form.district_code);
      params.append("address", this.blueseaactivity_form.address);
      backstage.BlueseaactivitySave(this, params);
    },
    blueseaactivity_query() {
      this.blueseaactivity_form.textarea = "";
      var params = new URLSearchParams();
      params.append("order_id", this.blueseaactivity_form.order_id);
      backstage.BlueseaactivityQuery(this, params);
    },
    blueseaactivity_update() {
      this.blueseaactivity_form.textarea = "";
      var params = new URLSearchParams();
      params.append("ImageIds", JSON.stringify(this.succesfile));
      params.append("biz_scene", this.blueseaactivity_form.biz_scene);
      params.append("province_code", this.blueseaactivity_form.province_code);
      params.append("city_code", this.blueseaactivity_form.city_code);
      params.append("district_code", this.blueseaactivity_form.district_code);
      params.append("address", this.blueseaactivity_form.address);
      params.append("order_id", this.blueseaactivity_form.order_id);
      backstage.BlueseaactivityUpdate(this, params);
    },
    OpenCpnOrg(row) {
      this.$router.push({
        path: "/Cpn/CpnOrg",
        name: "CpnOrg",
        params: {
          cpnID: row.cpnID,
        },
      });
    },
    handleClose() {},
    // 权限
    Jurisdiction(moduleActionName) {
      return Jurisdiction(moduleActionName, this);
    },
    // 多选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 多选赋值
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    // 搜索
    handleFilter() {
      this.listQuery.page = 1;
      this.fetchData();
    },
    // 新增
    handleCreate() {
      this.tableData = [];
      this.tableHeader = [];
      this.dialogStatus = "create";
      this.dialogFormVisible = true;
      this.active = 0;
      this.divid = 0;
      this.mngForm = {
        tableData: [],
        tableHeader: [],
        businesslicdialogVisible: false,
        iDpersondialogVisible: false,
        nationalemblemdialogVisible: false,
        cpnenclsures: [],
        showbigdialogVisible: false,
        showbigurl: "",
        eRPCpnId: "",
        deskey: "WUCRMWEB",
        iD: "",
        cpnID: "",
        regNo: "",
        regName: "",
        qalTyp: 0,
        qalTypStr: "个体户/企业",
        busdt: "",
        busnSDt: "",
        busnEDt: "",
        isLongDt: false,
        prv: "",
        cty: "",
        dit: "",
        addr: "",
        crt: "",
        ctr: "",
        mngeTyp: 0,
        businesslic_Url: "",
        iDperson_Url: "",
        nationalemblem_Url: "",
        indoorpic_Url: "",
        shopentrancepic_Url: "",
        placebusiness_Url: "",
        merchantagr_Url: "",
        leaseagrheader_Url: "",
        leaseagrarea_Url: "",
        leaseagrsign_Url: "",
        openActlicence_Url: "",
        otherPic1_Url: "",
        otherPic2_Url: "",
        otherPic3_Url: "",
        otherPic4_Url: "",
        otherPic5_Url: "",
        mngName: "",
        mngLnkPhn: "",
        mngMhTyp: 0,
        mngPrv: "",
        mngCty: "",
        mngDit: "",
        mngAdr: "",
        sttlTyp: "0",
        sttlActNm: "",
        sttlAct: "",
        sttlActBnk: "",
      };
    },
    handleCreateNorml() {
      this.tableData = [];
      this.tableHeader = [];
      this.dialogStatus = "create";
      this.dialogFormVisibleNoraml = true;
      this.form = {
        cpnID: "",
        name: "",
        cpnItTp: "",
        city: "",
        adr: "",
        tel: "",
        fax: "",
        opnBnk: "",
        actNo: "",
        taxID: "",
        lnkr: "",
        lnkPhn: "",
        lnkEml: "",
        cfo: "",
        cfoPhn: "",
        cfoEml: "",
        cio: "",
        cioPhn: "",
        cioEml: "",
        customer: "",
        opnDt: "",
        stt: "",
        brf: "",
        uptr: "",
        uptDtt: "",
        eRPCpnId: "",
        deskey: "WUCRMWEB",
         IsCheckMony: false,
        RootMsgAPI: "",
        CheckMonyMax: 0,
        isCheckMonyMax: false,


      };
    },
    // 编辑
    handleClickNorml(row) {
      this.tableData = [];
      this.tableHeader = [];
      this.form.cpnID = row.cpnID;
      this.form.name = row.name;
      this.form.cpnItTp = row.cpnItTp;
      this.form.city = row.city;
      this.form.adr = row.adr;
      this.form.tel = row.tel;
      this.form.fax = row.fax;
      this.form.opnBnk = row.opnBnk;
      this.form.actNo = row.actNo;
      this.form.taxID = row.taxID;
      this.form.lnkr = row.lnkr;
      this.form.lnkPhn = row.lnkPhn;
      this.form.lnkEml = row.lnkEml;
      this.form.cfo = row.cfo;
      this.form.cfoPhn = row.cfoPhn;
      this.form.cfoEml = row.cfoEml;
      this.form.cio = row.cio;
      this.form.cioPhn = row.cioPhn;
      this.form.cioEml = row.cioEml;
      this.form.customer = row.customer;
      this.form.opnDt = row.opnDt;
      this.form.stt = row.stt;
      this.form.brf = row.brf;
      this.form.uptr = row.uptr;
      this.form.uptDtt = row.uptDtt;
      this.form.eRPCpnId = row.erpCpnId;
      this.form.deskey = row.deskey;
      this.form.CheckMonyMax = row.checkMonyMax;
      this.form.RootMsgAPI = row.rootMsgAPI;
      this.form.IsCheckMony = row.isCheckMony;

      this.dialogStatus = "修改";
      this.dialogFormVisibleNoraml = true;
    },
    // 编辑
    handleClick(row) {
      this.tableData = [];
      this.tableHeader = [];
      this.active = 0;
      this.divid = 0;
      this.mngForm = {
        businesslicdialogVisible: false,
        iDpersondialogVisible: false,
        nationalemblemdialogVisible: false,
        cpnenclsures: [],
        showbigdialogVisible: false,
        showbigurl: "",
        eRPCpnId: "",
        deskey: "WUCRMWEB",
        iD: "",
        cpnID: "",
        regNo: "",
        regName: "",
        qalTyp: 0,
        qalTypStr: "个体户/企业",
        busdt: "",
        busnSDt: "",
        busnEDt: "",
        isLongDt: false,
        prv: "",
        cty: "",
        dit: "",
        addr: "",
        crt: "",
        ctr: "",
        mngeTyp: 0,
        businesslic_Url: "",
        iDperson_Url: "",
        nationalemblem_Url: "",
        indoorpic_Url: "",
        shopentrancepic_Url: "",
        placebusiness_Url: "",
        merchantagr_Url: "",
        leaseagrheader_Url: "",
        leaseagrarea_Url: "",
        leaseagrsign_Url: "",
        openActlicence_Url: "",
        otherPic1_Url: "",
        otherPic2_Url: "",
        otherPic3_Url: "",
        otherPic4_Url: "",
        otherPic5_Url: "",
        mngName: "",
        mngLnkPhn: "",
        mngMhTyp: 0,
        mngPrv: "",
        mngCty: "",
        mngDit: "",
        mngAdr: "",
        sttlTyp: "0",
        sttlActNm: "",
        sttlAct: "",
        sttlActBnk: "",
      };
      var params = new URLSearchParams();
      params.append("cpnID", row.cpnID);
      backstage.GetCpnById(this, params);
      this.dialogStatus = "修改";
      this.dialogFormVisible = true;
    },
    ShowClick(row) {
      this.tableData = [];
      this.tableHeader = [];
      this.active = 0;
      this.divid = 0;
      this.mngForm = {
        businesslicdialogVisible: false,
        iDpersondialogVisible: false,
        nationalemblemdialogVisible: false,
        cpnenclsures: [],
        eRPCpnId: "",
        deskey: "WUCRMWEB",
        iD: "",
        cpnID: "",
        regNo: "",
        regName: "",
        qalTyp: 0,
        qalTypStr: "个体户/企业",
        busdt: "",
        busnSDt: "",
        busnEDt: "",
        isLongDt: false,
        prv: "",
        cty: "",
        dit: "",
        addr: "",
        crt: "",
        ctr: "",
        mngeTyp: 0,
        businesslic_Url: "",
        iDperson_Url: "",
        nationalemblem_Url: "",
        indoorpic_Url: "",
        shopentrancepic_Url: "",
        placebusiness_Url: "",
        merchantagr_Url: "",
        leaseagrheader_Url: "",
        leaseagrarea_Url: "",
        leaseagrsign_Url: "",
        openActlicence_Url: "",
        otherPic1_Url: "",
        otherPic2_Url: "",
        otherPic3_Url: "",
        otherPic4_Url: "",
        otherPic5_Url: "",
        mngName: "",
        mngLnkPhn: "",
        mngMhTyp: 0,
        mngPrv: "",
        mngCty: "",
        mngDit: "",
        mngAdr: "",
        sttlTyp: "0",
        sttlActNm: "",
        sttlAct: "",
        sttlActBnk: "",
      };
      var params = new URLSearchParams();
      params.append("cpnID", row.cpnID);
      backstage.GetCpnById(this, params);
      this.dialogdetailsVisible = true;
    },
    // 保存
    saveForm(formName) {
      var arr = this.multipleSelection;
      var params = new URLSearchParams();
      if (this.mngForm.busdt != "" && this.mngForm.busdt != null) {
        var dt = this.mngForm.busdt;
        this.mngForm.busnSDt = new Date(dt[0]).toLocaleDateString();
        this.mngForm.busnEDt = new Date(dt[1]).toLocaleDateString();
      }
      params.append("mngForm", JSON.stringify(this.mngForm));
      params.append("tableData", JSON.stringify(this.mngForm.tableData));
      backstage.SaveCpn(this, params);
    },
    // 保存
    saveFormNormal() {
      var arr = this.multipleSelection;
      var params = new URLSearchParams();
      params.append("CpnID", this.form.cpnID);
      params.append("Name", this.form.name);
      params.append("CpnItTp", this.form.cpnItTp);
      params.append("City", this.form.city);
      params.append("Adr", this.form.adr);
      params.append("Tel", this.form.tel);
      params.append("Fax", this.form.fax);
      params.append("OpnBnk", this.form.opnBnk);
      params.append("ActNo", this.form.actNo);
      params.append("TaxID", this.form.taxID);
      params.append("Lnkr", this.form.lnkr);
      params.append("LnkPhn", this.form.lnkPhn);
      params.append("LnkEml", this.form.lnkEml);
      params.append("Cfo", this.form.cfo);
      params.append("CfoPhn", this.form.cfoPhn);
      params.append("CfoEml", this.form.cfoEml);
      params.append("Cio", this.form.cio);
      params.append("CioPhn", this.form.cioPhn);
      params.append("CioEml", this.form.cioEml);
      params.append("Customer", this.form.customer);
      params.append("Brf", this.form.IsCheckMony);
      params.append("CheckMonyMax", this.form.CheckMonyMax);
      params.append("RootMsgAPI", this.form.RootMsgAPI);
      params.append("IsCheckMony", this.form.IsCheckMony);
      debugger;
      if (this.form.isCheckMonyMax && this.form.CheckMonyMax <= 0) {
        this.$message({
          showClose: true,
          message: "q",
          type: "error",
        });
        return;
      }
      params.append(
        "ERPCpnId",
        this.form.eRPCpnId == undefined ? "" : this.form.eRPCpnId
      );
      params.append("Deskey", this.form.deskey);
      params.append("tableData", JSON.stringify(this.tableData));
      backstage.SaveCpnNormal(this, params);
    },
    // 删除
    deleteClick(row) {
      var multis = [];
      var params = new URLSearchParams();
      if (row == undefined || row == "") {
        var arr = this.multipleSelection;
        if (arr == undefined || arr.length <= 0) {
          this.$message({
            showClose: true,
            message: "请至少选中一行",
            type: "error",
          });
          return;
        } else {
          for (var i = 0; i < arr.length; i++) {
            multis.push(arr[i].id);
          }
          params.append("delds", JSON.stringify(multis));
        }
      } else {
        multis.push(row.id);
        params.append("delds", JSON.stringify(multis));
      }
      this.$confirm("确认删除吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "error",
      })
        .then((a) => {
          this.listLoading = true;
          backstage.DelCpn(this, params);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    // 查询
    fetchData() {
      this.listLoading = true;
      var params = new URLSearchParams();
      params.append(
        "Parms",
        '{"page":' +
          this.listQuery.page +
          ',"rows":' +
          this.listQuery.limit +
          "}"
      );
      params.append("Name", this.listQuery.title);
      backstage.GetCpnLst(this, params);
    },
    beforeUpload(file) {
      const isLt1M = file.size / 1024 / 1024 < 1;
      if (isLt1M) {
        return true;
      }
      this.$message({
        message: "请不要上传大于1m的文件",
        type: "warning",
      });
      return false;
    },
    handleSuccess({ results, header }) {
      this.tableData = results;
      this.tableHeader = header;
      this.orgshow = true;
      this.$message({
        showClose: true,
        message: "上传成功",
        type: "success",
      });
    },
  },
};
// 后台事件
var backstage = {
  // 获取Cpn集合
  GetCpnLst: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "GetCpnLst",
      params,
      "post",
      function (res) {
        thisobj.listLoading = false;
        var body = res.data.data;
        thisobj.CpnData = body.rows;
        thisobj.listQuery.page = body.page;
        thisobj.listQuery.total = body.records;
      },
      function (err) {}
    );
  },
  SaveCpn: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "SaveCpn",
      params,
      "post",
      function (res) {
        var body = res.data;
        if (body.success) {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "success",
            duration: 3000,
          });
          thisobj.fetchData();
          thisobj.dialogFormVisible = false;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  SaveCpnNormal: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "SaveCpnNormal",
      params,
      "post",
      function (res) {
        var body = res.data;
        if (body.success) {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "success",
            duration: 3000,
          });
          thisobj.fetchData();
          thisobj.dialogFormVisibleNoraml = false;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  BlueseaactivitySave: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "BlueseaactivitySave",
      params,
      "post",
      function (res) {
        var body = res.data;
        if (body.success) {
          thisobj.blueseaactivity_form.textarea = body.data;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  BlueseaactivityQuery: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "BlueseaactivityQuery",
      params,
      "post",
      function (res) {
        var body = res.data;
        if (body.success) {
          thisobj.blueseaactivity_form.textarea = body.data;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  BlueseaactivityUpdate: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "BlueseaactivityUpdate",
      params,
      "post",
      function (res) {
        var body = res.data;
        if (body.success) {
          thisobj.blueseaactivity_form.textarea = body.data;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  DelCpn: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "DelCpn",
      params,
      "post",
      function (res) {
        thisobj.listLoading = false;
        var body = res.data;
        if (body.success) {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "success",
            duration: 3000,
          });
          thisobj.fetchData();
          thisobj.dialogFormVisible = false;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  GetCpnById: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "GetCpnById",
      params,
      "post",
      function (res) {
        var body = res.data;
        thisobj.mngForm = body.data;
      },
      function (err) {}
    );
  },
};
</script>
<style scoped>
.red {
  color: red;
}

.green {
  color: green;
}

.infocontent_line {
  display: flex;
  justify-content: flex-start;
  text-align: left;
}

.spanshow {
  position: relative;
  top: 80px;
  color: #3b5daf;
  cursor: pointer;
}

.Nationalemblem {
  margin-left: 140px;
}

.cpn_title {
  font-size: 20px !important;
  font-family: Source Han Sans CN;
  font-weight: 600;
  color: #304156;
  opacity: 1;
}

.title {
  width: 100%;
  overflow: hidden;
  justify-content: space-between;
  align-items: center;
  display: flex;
  height: 95px;
  margin: -40px 0px -14px 0px;
}

.pcd {
  margin-right: 70px;
}

/* ::v-deep.el-form--inline .el-form-item__label{
    display: block !important;
    text-align: left !important;
  } */

::v-deep .el-textarea__inner {
  min-height: 36px !important;
}
</style>
<style>
.show {
  display: block;
}

.hide {
  display: none;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}

.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 100px;
  height: 100px;
  line-height: 100px;
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  display: block;
}

.cpnformdialog .el-dialog__body {
  overflow: auto;
  height: 670px;
}

.cpnformdialog .el-dialog__header {
  padding: 0px;
  padding-bottom: 0px;
}

.cpninfo .el-form-item__content {
  width: 280px;
  margin-right: 20px;
}

.cpninfopic .el-form-item__content {
  width: 120px;
  margin-right: 20px;
}

.cpninfo .el-form-item {
  margin-bottom: 10px !important;
}

.cpninfo .el-form-item .el-form-item__label {
  padding-bottom: 0px !important;
}

.Nationalemblem .el-form-item .el-form-item__label {
  padding-bottom: 0px !important;
}

.pcd .el-form-item .el-form-item__label {
  padding-bottom: 0px !important;
}

.pcd .mngaddr {
  width: 280px;
  margin-left: 70px;
}

.cpninfo .el-form-item__content .el-select el-select--medium {
  width: 280px;
}

.cpninfo .el-form-item__content .el-input__inner {
  width: 280px;
}

.infocontent_line .el-form--label-top .el-form-item__label {
  padding-bottom: 0px !important;
}

.detialcpnformdialog .el-form-item {
  pointer-events: none;
}

.detialcpnformdialog .el-form-item .spanshow {
  pointer-events: auto;
}

.detialcpnformdialog .el-form-item .spanshow2 {
  pointer-events: auto;
}

.cpntable .cell .el-button--primary {
  margin-top: 5px;
  margin-left: 5px;
}

.dialog-title .el-dialog__title {
  font-size: 18px !important;
}

.dialog-title {
  font-size: 18px !important;
}

/* .el-form-item--medium .el-form-item__content{
  width: 80%;
} */
#ipt .el-form-item__content {
  width: 100%;
}

.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before {
  margin-right: 0px !important;
}
</style>
